package com.bitoon.basketdudes.web;

import com.opensymphony.xwork2.*;
import com.opensymphony.xwork2.interceptor.I18nInterceptor;
import java.util.Map;
import org.apache.log4j.Logger;

public class PruebaLocale extends ActionSupport {

    protected Map session;
    private Logger log = Logger.getLogger(PruebaLocale.class);

    public String execute() {
        session = ActionContext.getContext().getSession();
        return SUCCESS;
    }

    public String getIdioma() {
        log.debug(">>>>>>>>>>> init idioma: Antes, en sesion: " + I18nInterceptor.DEFAULT_SESSION_ATTRIBUTE + ": " + session.get(I18nInterceptor.DEFAULT_SESSION_ATTRIBUTE));
        log.debug(">>>>>>>>>>> init idioma: getLocale: " + ActionContext.getContext().getLocale());
        return ActionContext.getContext().getLocale().getLanguage();
    }

}